@extends('layouts.app')

@section('title', $user->name . (isset($pageTitle)?$pageTitle:' 的个人中心'))
@section('content')
    <br/>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
            @include('layouts._message')
            </div>
            <div class="col-lg-3 col-md-3 hidden-sm hidden-xs user-info">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="media">
                            <div class="media">
                                <div class="media-left">
                                    <div class="image">
                                        <a href="{{ route('users.edit',[$user->id]) }}" class="popover-with-html" data-content="修改头像" data-original-title="" title="">
                                            <img class="media-object avatar-112 avatar img-thumbnail" src="{{ $user->avatar }}"  width="100"  height="100"></a>

                                    </div>


                                </div>
                                <div class="media-body" >
                                    <h3 class="media-heading" style="margin-top: 2px">
                                        {{ $user->name }}
                                    </h3>
                                    <div class="item">


                                        <svg width="14" height="16" viewBox="0 0 14 14" class="Icon Icon--male" aria-hidden="true" style="height: 16px; width: 14px;fill:#9fadc7;top: 2px;position: relative;">
                                            <g><path d="M3.025 10.64c-1.367-1.366-1.367-3.582 0-4.95 1.367-1.366 3.583-1.366 4.95 0 1.367 1.368 1.367 3.584 0 4.95-1.367 1.368-3.583 1.368-4.95 0zm10.122-9.368c-.002-.414-.34-.75-.753-.753L8.322 0c-.413-.002-.746.33-.744.744.002.413.338.75.75.752l2.128.313c-.95.953-1.832 1.828-1.832 1.828-2.14-1.482-5.104-1.27-7.013.64-2.147 2.147-2.147 5.63 0 7.777 2.15 2.148 5.63 2.148 7.78 0 1.908-1.91 2.12-4.873.636-7.016l1.842-1.82.303 2.116c.003.414.34.75.753.753.413.002.746-.332.744-.745l-.52-4.073z" fill-rule="evenodd"></path></g></svg>
                                    </div>
                                    <div class="item">
                                        第  {{ $user->id }} 位会员
                                    </div>
                                    <div class="item number">
                                        注册于 <span class="timeago popover-with-html" data-content="{{ $user->created_at }}" data-original-title="" title="">{{ $user->created_at->diffForHumans() }}</span>
                                    </div>

                                    <div class="item number">
                                        活跃于 <span class="timeago popover-with-html" data-content="{{ $user->last_actived_at }}" data-original-title="" title="">{{ $user->last_actived_at->diffForHumans() }}</span>
                                    </div>

                                </div>
                            </div>
                            <div class="stats">
                                <hr>
                                <a href="{{ route('users.followings', $user->id) }}" style="border-left:0px;">
                                    <strong id="following" class="stat">
                                        {{ count($user->followings) }}
                                    </strong>
                                    关注
                                </a>
                                <a href="{{ route('users.followers', $user->id) }}">
                                    <strong id="followers" class="stat">
                                        {{ count($user->followers) }}
                                    </strong>
                                    粉丝
                                </a>
                                <a href="{{ route('users.show', $user->id) }}">
                                    <strong id="statuses" class="stat">
                                        12
                                    </strong>
                                    动态
                                </a>
                            </div>
                            <div class="">
                                <hr>
                                @if (Auth::check())
                                    @include('users._follow_form')
                                @endif
                            </div>
                            <div style="margin-top: 15px">
                                @if ($user->id !== Auth::user()->id)
                                <button type="submit" class="btn  btn-default btn-block">
                                    <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> 私信
                                </button>
                                @else
                                    <button type="submit" class="btn  btn-default btn-block">
                                        {{--<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>--}}
                                        编辑个人资料
                                    </button>
                                 @endif
                            </div>


                        </div>
                    </div>
                </div>
                <div class="box text-center">

                    <div class="padding-sm user-basic-nav">
                        <ul class="list-group" style="margin-bottom: 0px">

                            <a href="{{ route('talents') }}" class="">
                                <li class="list-group-item">
                                    <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>&nbsp;
                                    Ta 的问题</li>
                            </a>
                            <a href="{{ route('lessons') }}" class="">
                                <li class="list-group-item">
                                    <span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span>&nbsp;
                                    Ta 的视频</li>
                            </a>
                            <a href="{{ route('courses') }}" class="">
                                <li class="list-group-item">
                                    <span class="glyphicon glyphicon-education" aria-hidden="true"></span>&nbsp;
                                    Ta 的课程
                                </li>
                            </a>



                            <a href="{{ route('lessons') }}" class="">
                                <li class="list-group-item">
                                    <span class=" glyphicon glyphicon-usd" aria-hidden="true"></span>&nbsp;
                                    Ta 的悬赏</li>
                            </a>

                            <a href="{{ route('lessons') }}" class="">
                                <li class="list-group-item">
                                    <span class="glyphicon glyphicon-link" aria-hidden="true"></span>&nbsp;
                                    Ta 的项目</li>
                            </a>

                        </ul>
                    </div>

                </div>
            </div>
            <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
                <div class="panel panel-default">
                    <div class="panel-body">
                    <span>
                        <h1 class="panel-title pull-left" style="font-size:30px;"> <small>{{ $user->mobile }}</small></h1>
                    </span>
                    </div>
                </div>
                <hr>
                <div class="panel panel-default">
                    <div class="panel-body">
                        暂无数据 ~_~
                    </div>
                </div>
                <hr>
                {{-- 用户发布的内容 --}}
                <div class="panel panel-default">
                    <div class="panel-body">

                        <div>

                            <!-- Nav tabs -->
                            <ul class="nav nav-tabs">
                                <li role="presentation" class="{{ active_class(
                                                                          (!if_query('feeds', 'marks'))&&
                                                                          (!if_query('feeds', 'followings')) &&
                                                                          (!if_query('feeds', 'follower')) &&
                                                                          (!if_query('feeds', 'friends')) &&
                                                                          (!if_query('feeds', 'topics')) &&
                                                                          (!if_query('feeds', 'reply'))
                                                                          )}}">
                                    <a href="{{ Request::url() }}?feeds=default" >全部动态</a>
                                </li>
                                <li role="presentation" class="{{ active_class(if_query('feeds', 'marks')) }}"> <a href="{{ Request::url() }}?feeds=marks">收藏</a></li>
                                <li role="presentation" class="{{ active_class(if_query('feeds', 'followings')) }}"> <a href="{{ Request::url() }}?feeds=followings">关注</a></li>
                                <li role="presentation" class="{{ active_class(if_query('feeds', 'follower')) }}"> <a href="{{ Request::url() }}?feeds=follower">粉丝</a></li>
                                <li role="presentation" class="{{ active_class(if_query('feeds', 'friends')) }}"> <a href="{{ Request::url() }}?feeds=friends">基友</a></li>
                                <li role="presentation " class="{{ active_class(if_query('feeds', 'topics')) }}"> <a href="{{ Request::url() }}?feeds=topics">帖子</a></li>
                                <li role="presentation" class="{{ active_class(if_query('feeds', 'reply')) }}"> <a href="{{ Request::url() }}?feeds=reply">回复</a></li>
                            </ul>
                            {{--<ul class="nav nav-tabs" role="tablist">--}}
                                {{--<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">全部动态</a></li>--}}
                                {{--<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">收藏</a></li>--}}
                                {{--<li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">关注</a></li>--}}
                                {{--<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">粉丝</a></li>--}}
                                {{--<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">基友</a></li>--}}
                                {{--<li role="presentation"><a href="#topics" aria-controls="topics" role="tab" data-toggle="tab">话题</a></li>--}}
                                {{--<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">回复</a></li>--}}
                            {{--</ul>--}}

                            <!-- Tab panes -->
                            <div class="tab-content panel">
                                <div role="tabpanel" class="tab-pane {{ active_class( (!if_query('feeds', 'marks'))&&
                                                                          (!if_query('feeds', 'followings')) &&
                                                                          (!if_query('feeds', 'follower')) &&
                                                                          (!if_query('feeds', 'friends')) &&
                                                                          (!if_query('feeds', 'topics')) &&
                                                                          (!if_query('feeds', 'reply'))
                                                                          )}}" >
                                    暂无数据 ~_~
                                </div>
                                <div role="tabpanel" class="tab-pane {{ active_class(if_query('feeds', 'marks')) }}" >
                                    暂无数据 ~_~
                                </div>
                                <div role="tabpanel" class="tab-pane {{ active_class(if_query('feeds', 'followings')) }}" >
                                    暂无数据 ~_~
                                </div>
                                <div role="tabpanel"  class="tab-pane {{ active_class(if_query('feeds', 'follower')) }}" >
                                    暂无数据 ~_~
                                </div>

                                <div role="tabpanel" class="tab-pane {{ active_class(if_query('feeds', 'friends')) }}">
                                    暂无数据 ~_~
                                </div>
                                <div role="tabpanel"  class="tab-pane {{ active_class(if_query('feeds', 'topics')) }}">
                                    @include('users._home_topics', ['topics' => isset($topics)?$topics:null])
                                </div>
                                <div role="tabpanel"  class="tab-pane {{ active_class(if_query('feeds', 'reply')) }}" >
                                    @include('users._home_topics_replies', ['replies' =>$user->replies()->with('forumTopics')->recent()->paginate(5)])
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@stop